<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of HtmlElementos
 *
 * @author Gustavo
 */
class HtmlElementos {
    //put your code here
    private $tipo;
    private $class;
    private $lang;
    private $tag;
    private $fechamento;
    private $caminho;
    private $legenda;
    
    function __construct($tipo, $class, $lang, $caminho, $legenda) {
        $this->tipo = $tipo;
        $this->class = $class;
        $this->lang = $lang;
        $this->caminho = $caminho;
        $this->legenda = $legenda;
        $this->printCodigo();
    }
    
    

    
    public function  printCodigo(){
        switch ($this->tipo){
            case "link":
                $this->codigoLink();
                echo $this->tag;
                break;
            case "imagem":
                $this->codigoImagem();
                echo $this->tag;
                break;
            case "select":
                $this->codigoOptionSelect();
                echo $this->tag;
                break;
             case "div":
                $this->codigoDiv();
                echo $this->tag;
                break;
            case "p":
                $this->codigoP();
                echo $this->tag;
                break;
            case "li":
                $this->codigoP();
                echo $this->tag;
                break;
            case "text":
                $this->codigoCampoTexo();
                echo $this->tag;
                break;
            case "codicoselect":
                $this->codigoSelect();
                echo $this->tag;
                break;
            case "butao":
                $this->codigoButtao();
                echo $this->tag;
                break;
            case "td":
                $this->codigoTd();
                echo $this->tag;
                break;
            case "tr":
                $this->codigoTr();
                echo $this->tag;
                break;
            case "codigoTdEspecial":
                $this->codigoTdEspecial();
                echo $this->tag;
                break;
            case "codigoLinkGenerico":
                $this->codigoLinkGenerico();
                echo $this->tag;
                break;
            case "codigoImagemGenerica":
                $this->codigoImagemGenerica();
                echo $this->tag;
                break;

        }
        
    }
    public function fechaCodigo(){
        echo $this->fechamento;
    }
    private function codigoLink(){
        $this->tag =
        "
            <a href='#' class='$this->class' lang='$this->lang' >
            "
        ;
        $this->fechamento = "</a>";
    }
    private function codigoLinkGenerico(){
        $this->tag =
        "
            <a href='$this->caminho' class='$this->class' lang='$this->lang' >
            "
        ;
        $this->fechamento = "</a>";
    }
    private function codigoImagem(){
        $this->tag =
        "
            <img src='imagens/$this->caminho' class='$this->class' alt='$this->legenda' title='$this->legenda' >
            "
        ;
    }
     private function codigoImagemGenerica(){
        $this->tag =
        "
            <img src='$this->caminho' class='$this->class' alt='$this->legenda' title='$this->legenda' >
            "
        ;
    }
     private function codigoOptionSelect(){
        $this->tag =
        "
            <option value='$this->lang' >$this->legenda</option>
            "
        ;
    }
    
    
    private function codigoDiv(){
        $this->tag =
        "
            <div id='$this->lang' class='$this->class' >
            "
        ;
         $this->fechamento = "</div>";
    }


    private function codigoP(){
        $this->tag =
        "
            <p class='$this->class'>$this->lang</p>
            "
        ;
		$this->fechamento = "</p>";
    }
    private function codigoCampoTexo(){
        $this->tag =
        "
            $this->legenda<input class='$this->class' id='$this->caminho' type='text' size='$this->lang'  />
            "
        ;
		
    }
     private function codigoButtao(){
        $this->tag =
        "
            <input class='$this->class' id='$this->legenda' type='button' value='$this->lang'  />
            "
        ;
		
    }
    
       private function codigoSelect(){
        $this->tag =
        "
            $this->legenda<select class='$this->class' id='$this->lang'>
            "
        ;
        $this->fechamento = "</select>";
		
    }
    private function codigoLi(){
        $this->tag =
        "
            <li class='$this->class'>$this->lang
            "
        ;
		$this->fechamento = "</li>";
    }
    private function codigoTr(){
        $this->tag =
        "
            <tr class='$this->class'>
            "
        ;
		$this->fechamento = "</tr>";
    }
    private function codigoTd(){
        $this->tag =
        "
            <td class='$this->class'>$this->lang</td>
            "
        ;
		
    }
     private function codigoTdEspecial(){
        $this->tag =
        "
            <td><a href='#' class='$this->class' lang='$this->lang' >
                <img src='imagens/$this->caminho' class='visualizarDemandaCompleta' alt='$this->legenda' title='$this->legenda' >
                </td>
            "
        ;
		
    }
}

?>
